<include file="Public:header"/>
<script type="text/javascript" src="__WEBPUBLIC__/Admin/js/ajax-operate.js"></script>
<!--主页面-->
<div id="main-content" class="content">
    <div class="page-header page-header1 clearfix">
        <h3>课程审核管理</h3>
        <ul class="nav nav-tabs">
            <li class="active">
                <a>课程列表</a>
            </li>
        </ul>
    </div>
    <div class="search-content">
        <form action="{:U('Kc/jkclist')}" method="post" class="search-form form-inline" role="form">
            <div class="form-group">
                <label class="sr-only" for="title">课程名</label>
                <input class="earch-input form-control" id="title" type="text" name="name" value="{$_REQUEST['name']}" placeholder="课程名"/>　
            </div>
            <div class="form-group">
                <label class="sr-only" for="title">教练名</label>
                <input class="earch-input form-control" type="text" name="tname" value="{$_REQUEST['tname']}" placeholder="教练名"/>　
            </div>
            <button type="submit" class="btn derive">查询</button>
        </form>
    </div>
    <div class="content-box-table content-box-content">
        <form class="batch-form">
            <table class="table table-striped table-framed table-hover">
                <thead>
                    <tr>
                        <th>
                            编号
                        </th>
                        <th>
                            课程名
                        </th>
                        <th>
                            课时
                        </th>
                        <th>课时</th>
                        <th>创建时间</th>
                        <th>修改时间</th>
                        <th>申请时间</th>

                        <th>教练</th>
                        <th>状态</th>
                        <th width="10%">操作</th>
                    </tr>
                </thead>
                <tbody class="tbody">
                    <if condition="empty($list)">
                        <tr><td colspan="20"><span style="font-size:14px;">暂无数据</span></td></tr>
                    </if>
                    <volist name="list" id="vo">
                        <tr>
                            <td>{$vo['id']}</td>
                            <td>{$vo['name']}</td>
                            <td>{$vo['ktime']}课时</td>
                            <td>{$vo['datestr']}{$vo['htime']}</td>


                            <td>{$vo['ctime']|date='Y-m-d H:i:s',###}</td>
                            <td>{$vo['utime']|date='Y-m-d H:i:s',###}</td>
                            <td>{$vo['infotime']}</td>

                            <td>{$vo['tname']}</td>
                            <td>
                                <if condition="$vo['status'] eq 0">
                                待审核
                                <elseif condition="$vo['status'] eq 1"/>
                                已发布
                                <elseif condition="$vo['status'] eq 4"/>
                                已下线
                                </if>
                            </td>
                            <td>
                                <if condition="$vo['status'] eq 0">
                                    <a data-id="{$vo['id']}" title="通过" class="modify" status="1">
                                        <span class="icon glyphicon glyphicon-refresh"></span>
                                    </a>
                                    <else/>
                                    <a title="不通过" class="modify" data-id="{$vo['id']}" status="0">
                                        <span class="icon glyphicon glyphicon-edit"></span>
                                    </a>
                                </if>
                                <a href="#" title="删除" class="delete-delete">
                                    <span class="icon glyphicon glyphicon-remove"></span>
                                </a><input type="hidden" value="{:U('Kc/deletejkc',array('id'=>$vo['id']))}">
                            </td>
                        </tr>
                    </volist>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="20">
                            <div class="fr">
                                {$page}
                            </div>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>

<script type="text/javascript">
    $(".modify").on('click',function() {
        var id = $(this).data("id");
        var status = $(this).attr("status");
        console.log(id,status);
        if ( id && status ) {
            $.ajax({
                url:"{:U('Kc/savekc')}",
                data:{id:id,status:status},
                dataType:"json",
                type:"post",
                success:function ( res ) {
                    layer.msg(res.message);
                    if (res.flag == "success") {
                        setTimeout(function () {
                            window.location.reload();
                        },500);
                    }
                }
            })
        }
    })
</script>
<include file="Public:footer"/>
